home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / Shareware Internet / Gráficos / GraphicConverter 2.3.1 (US) / Plug-ins Dev.-Kit / Header.p next >
Text File  |  1995-05-28  |  3KB  |  132 lines

  1. unit Header;
  2.  
  3. interface
  4.  
  5.     uses
  6.         DefComp,
  7. {$IFC POWERPC}
  8.         QuickDraw, Files;
  9. {$ELSEC}
  10.         Dummy;
  11. {$ENDC}
  12.  
  13.  
  14. { File type of an extension: PLUG }
  15. { Creator of an extension: GKON }
  16. {}
  17. { Definition of an import extension: }
  18. { STR# number 1024 index 1 contains the name }
  19. { STR# number 1024 index 2 contains the file type of the graphic files }
  20. { PLUG number 1024 contains the 68K code resource for the import extension }
  21. {}
  22. { Definition of an export extension: }
  23. { STR# number 2048 index 1 contains the name }
  24. { STR# number 2048 index 2 contains the file type of the graphic files }
  25. { PLUG number 2048 contains the 68K code resource for the export extension }
  26. {}
  27. { Definition of an filter extension: }
  28. { STR# number 4096 index contains the name }
  29. { PLUG number 4096 contains the 68K code resource for the filter extension }
  30. {}
  31. { One extension can contain the import and export resources }
  32.  
  33.     type
  34.         T_ColorTableArr = array[0..255] of RGBColor;
  35.         T_ColorTablePtr = ^T_ColorTableArr;
  36.  
  37.         T_ImportRec = record
  38.                 version: Longint; { 1 }
  39.  
  40.                 callKind: Longint; { 0 - all available, 1 - format was especially selected }
  41.  
  42.                 progressProcPtr: ptr; { nil, if not function available }
  43.                 progressType: Longint; { 0-68K, 1-PPC }
  44.  
  45.                 createVectorPict: Longint; { 0-no, 1-yes }
  46.                 vectorPictHdl: PicHandle;
  47.  
  48.                 srcDataHdl: Handle;
  49.                 srcDataSize: Longint;
  50.                 srcFile: FSSpec;
  51.  
  52.                 destDataHdl: Handle;
  53.                 destBitsPerPixel: Longint;
  54.                 destBytesPerLine: Longint;
  55.                 destWidth: Longint;
  56.                 destHeight: Longint;
  57.                 destDataSize: Longint; { in bytes }
  58.                 destColorTablePtr: T_ColorTablePtr; { preallocated for 256 colors, fill only the fields }
  59.                 destKindStr: str255;
  60.                 destFileType: ResType;
  61.  
  62.                 success: Longint; { 0 - no, 1 - yes }
  63.                 
  64.                 commentHdl : Handle; { only if version >= 1 }
  65.             end;
  66.         T_ImportPtr = ^T_ImportRec;
  67.  
  68.         T_ExportRec = record
  69.                 version: Longint; { 1 }
  70.  
  71.                 progressProcPtr: ptr;  { nil, if not function available }
  72.                 progressType: Longint; { 0-68K, 1-PPC }
  73.  
  74.                 srcDataPtr: ptr;
  75.                 srcBitsPerPixel: Longint;
  76.                 srcBytesPerLine: Longint;
  77.                 srcWidth: Longint;
  78.                 srcHeight: Longint;
  79.                 srcColorTablePtr: T_ColorTablePtr;
  80.                 srcDataSize: Longint; { in bytes }
  81.  
  82.                 destFSSpecRec: FSSpec;
  83.  
  84.                 success: Longint; { 0 - no, 1 - yes }
  85.                 
  86.                 commentHdl : Handle; { only if version >= 1 }                
  87.             end;
  88.         T_ExportPtr = ^T_ExportRec;
  89.  
  90.         T_FilterRec = record
  91.                 version: Longint; { 1 }
  92.  
  93.                 progressProcPtr: ptr;  { nil, if not function available }
  94.                 progressType: Longint; { 0-68K, 1-PPC }
  95.  
  96.                 srcDataHdl: Handle; { don't free !!! }
  97.                 srcBitsPerPixel: Longint;
  98.                 srcBytesPerLine: Longint;
  99.                 srcWidth: Longint;
  100.                 srcHeight: Longint;
  101.                 srcColorTablePtr: T_ColorTablePtr;
  102.                 srcDataSize: Longint; { in bytes }
  103.  
  104.                 destDataHdl: Handle; { nil on entry }
  105.                 destBitsPerPixel: Longint;
  106.                 destBytesPerLine: Longint;
  107.                 destWidth: Longint;
  108.                 destHeight: LOngint;
  109.                 destColorTablePtr: T_ColorTablePtr;
  110.                 destDataSize: Longint; { in bytes }
  111.  
  112.     { if destDataHdl is nil on exit than the filter changes the srcData }
  113.  
  114.                 success: Longint; { 0 - no, 1 - yes }
  115.  
  116.                 commentHdl : Handle; { only if version >= 1 }
  117.             end;
  118.         T_FilterPtr = ^T_FilterRec;
  119.  
  120.     const
  121.         C_SetTitle = 0;
  122.         C_InitProgressBar = 1;
  123.         C_SetProgressValue = 2;
  124.         C_ClearProgressBar = 3;
  125.  
  126. { prototype for progress function: }
  127. { procedure Progress(command:Longint; title:str255; percent:Longint);}
  128. { percent in the range 0..100 }
  129.  
  130. implementation
  131.  
  132. end.